package com.example.management.system.dao

import com.example.management.common.domain.UserRoleDO
import org.apache.ibatis.annotations.Mapper

/**
 * 用户与角色对应关系
 *
 * @author chglee
 * @email 1992lcg@163.com
 * @date 2017-10-03 11:08:59
 */
@Mapper
interface UserRoleDao {

    operator fun get(id: Long?): UserRoleDO

    fun list(map: Map<String, Any>): List<UserRoleDO>

    fun count(map: Map<String, Any>): Int

    fun save(userRole: UserRoleDO): Int

    fun update(userRole: UserRoleDO): Int

    fun remove(id: Long?): Int

    fun batchRemove(ids: Array<Long>): Int

    fun listRoleId(userId: Long?): List<Long>

    fun removeByUserId(userId: Long?): Int

    fun removeByRoleId(roleId: Long?): Int

    fun batchSave(list: List<UserRoleDO>): Int

    fun batchRemoveByUserId(ids: Array<Long>): Int
}
